import request from '@/utils/request';

const commentBaseURL = '/comment'

export function getCommentDetailById(params){
    return request({
        url: commentBaseURL+'/getCommentDetailById',
        method: 'get',
        params
    })
}

export function deleteCommentById(data){
    return request({
        url: commentBaseURL+'/deleteCommentById',
        method: 'post',
        data
    })
}

export function createComment(data){
    return request({
        url: commentBaseURL+'/createComment',
        method: 'post',
        data
    })
}

/**
 * 发表评论
 * @param {comment} data 
 * @returns 
 */
export function publishComment(data){
    return request({
        url: commentBaseURL+'/publishComment',
        method: 'post',
        data
    })
}

export function updateComment(data){
    return request({
        url: commentBaseURL+'/updateComment',
        method: 'post',
        data
    })
}

export function getCommentPage(params) {
    return request({
        url: commentBaseURL+'/getCommentPage',
        method: 'get',
        params
    })
}

export function getCommentListByArticleId(params) {
    return request({
        url: commentBaseURL+'/getCommentListByArticleId',
        method: 'get',
        params
    })
}

export function getAllCommentData(params) {
    return request({
        url: commentBaseURL+'/getAllCommentData',
        method: 'get',
        params
    })
}

export function getCommentTotalCount(params) {
    return request({
        url: commentBaseURL+'/getCommentTotalCount',
        method: 'get',
        params
    })
}